package com.sxx.beautifulcity.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.sxx.beautifulcity.R;
import com.sxx.beautifulcity.activity.BarbecueActivity;
import com.sxx.beautifulcity.activity.PluckActivity;

/**
 * Created by dllo on 15/10/26.
 */
public class SearchFragment extends Fragment{
private TextView pluckTv, barbecueDetailTv, expandTv ,tourTv, bathingTv, look_chrysanthemumTv,
        sunflowerTv, chateauTv, barbecueTv , finishTv , red_leavesTv , look_moon;

    /***
     * 加载布局文件
     * @param inflater
     * @param container
     * @param savedInstanceState
     * @return
     */
    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

     View v = inflater.inflate(R.layout.fragment_search_activity , container , false);

        return v;
    }

    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        pluckTv = (TextView) view.findViewById(R.id.pluckTv);
        barbecueDetailTv = (TextView) view.findViewById(R.id.barbecueDetailTv);
        expandTv = (TextView) view.findViewById(R.id.expandTv);
        tourTv = (TextView) view.findViewById(R.id.tourTv);
        look_chrysanthemumTv = (TextView) view.findViewById(R.id.look_chrysanthemumTv);
        sunflowerTv = (TextView) view.findViewById(R.id.sunflowerTv);
        chateauTv = (TextView) view.findViewById(R.id.chateauTv);
        barbecueTv = (TextView) view.findViewById(R.id.barbecueTv);
        finishTv = (TextView) view.findViewById(R.id.finishTv);
        red_leavesTv = (TextView) view.findViewById(R.id.red_leavesTv);
        look_moon = (TextView) view.findViewById(R.id.look_moon);
        pluckTv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getActivity(), PluckActivity.class);
                startActivity(intent);
                getActivity().finish();
            }
        });

        barbecueDetailTv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getActivity() , BarbecueActivity.class);
                startActivity(intent);
                getActivity().finish();
            }
        });
    }
}
